package com.api.demo.dto.sync;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;
import java.util.Set;

/**
 * @description: 同步发票DTO
 * @author: yanming
 * @createDate: 2022/10/04 10:29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "同步发票DTO")
public class SyncDataInvoiceDTO extends SyncDataDTO {


    private static final long serialVersionUID = -6968139258525856318L;
    @ApiModelProperty(value = "订单ID集合", required = true)
    @NotEmpty(message = "订单ID集合不能为空")
    private Set<String> orderIdList;

    /**
     * 发票类型
     * 1-增值税普通纸质发票；
     * 2-增值税专用纸质发票；
     * 3-增值税普通电子发票；
     * 4-增值税专用电子发票
     */
    @ApiModelProperty(value = "发票类型")
    @NotNull(message = "发票类型不能为空")
    @Max(value = 4, message = "发票类型错误")
    @Min(value = 1, message = "发票类型错误")
    private Integer type;

    @ApiModelProperty(value = "发票", required = true)
    @NotBlank(message = "发票不能为空")
//    @URL(message = "发票链接异常")
    @Length(max = 20000, message = "发票链接超过20000长度")
    private String invoice;

    @ApiModelProperty(value = "税票")
    @URL(message = "税票链接异常")
    private String receipt;

    @ApiModelProperty(value = "发票类目名称")
    @NotBlank(message = "发票类目名称不能为空")
    private String invoiceCatalogName;

    @ApiModelProperty(value = "开票时间")
    @NotBlank(message = "开票时间不能为空")
    private String invoiceDate;

    @ApiModelProperty(value = "创建时间")
    @NotBlank(message = "创建时间不能为空")
    private String createDate;
}